package com.ruoyi.web.controller.diseasestatistics;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.diseasestatistics.domain.Diseasestatistics;
import com.ruoyi.diseasestatistics.service.IDiseasestatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 省份患病数量统计Controller
 * 
 * @author ruoyi
 * @date 2024-07-07
 */
@RestController
@RequestMapping("/diseasestatistics/diseasestatistics")
public class DiseasestatisticsController extends BaseController
{
    @Autowired
    private IDiseasestatisticsService diseasestatisticsService;

    /**
     * 查询省份患病数量统计列表
     */
    @PreAuthorize("@ss.hasPermi('diseasestatistics:diseasestatistics:list')")
    @GetMapping("/list")
    public TableDataInfo list(Diseasestatistics diseasestatistics)
    {
        startPage();
        List<Diseasestatistics> list = diseasestatisticsService.selectDiseasestatisticsList(diseasestatistics);
        return getDataTable(list);
    }

    /**
     * 导出省份患病数量统计列表
     */
    @PreAuthorize("@ss.hasPermi('diseasestatistics:diseasestatistics:export')")
    @Log(title = "省份患病数量统计", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, Diseasestatistics diseasestatistics)
    {
        List<Diseasestatistics> list = diseasestatisticsService.selectDiseasestatisticsList(diseasestatistics);
        ExcelUtil<Diseasestatistics> util = new ExcelUtil<Diseasestatistics>(Diseasestatistics.class);
        util.exportExcel(response, list, "省份患病数量统计数据");
    }


}
